<%-- 
    Document   : jadwalPemesananGedung
    Created on : Nov 10, 2011, 10:48:11 PM
    Author     : Renaldo Malau
--%>

<%@page import="databaseConnection.DatabaseConnection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="kontrol" scope="application" class="kontroler.kontrolerLogin" />
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body bgcolor="black">
        <table border="1" bgcolor="white">
            <tr>
                <td colspan="6" > 
                    <img src="images hotel/894_1_1000 bbg central hotel Bangkok 1.jpg" height="140" width="1350">
            <marquee style="font-family:Broadway BT;color:blue;font-size:20px">WELCOME TO HOTEL ADMF WEBSITE</marquee>
        </td>            </tr>
    <tr>
        <td align="justify" valign="top" bgcolor="#69F"  height="500">

            <img src="images hotel/menu header.jpg" height="65" width="270" align="middle">
            <table border="1" style="background: #CF9" align="center" width="270">
                <tr><td><a href="beranda.jsp"><input type="button" value="Beranda"/></a></td></tr>
                <tr><td><a href="lihatInfo_pilihJenisRuang.jsp" ><input type="button" value="Lihat info ruang"/></a></td></tr>
                <tr><td> <a href="pesan_pilihJenisRuang.jsp"><input type="button" value="Pesan ruang"/></a></td></tr>
                <tr><td> <a href="jadwalPemesananKamar.jsp"><input type="button" value="Jadwal pemesanan Kamar"/></a></td></tr>
                <tr><td> <a href="jadwalPemesananRestoran.jsp"><input type="button" value="Jadwal pemesanan restoran"/></a></td></tr>
                <tr><td> <a href="jadwalPemesananGedung.jsp"><input type="button" value="Jadwal pemesanan gedung"/></a></td></tr>
            </table>
        </td>




        <td width="80%" height="70%">

            <%!
                public String bgcolor(String data) {
                    if (data.equalsIgnoreCase("kosong")) {
                        return "#6F6";
                    } else if (data.equalsIgnoreCase("ada")) {
                        return "#FE5A23";
                    } else {
                        return "#999";
                    }
                }
            %>

            <%
                DatabaseConnection conn = new DatabaseConnection();
                java.sql.Statement statement = conn.connection.createStatement();

            %>


            <center><b><h1 style="background-color:#69F">Jadwal Pemakaian Gedung<HR></h1></b></center>
            <h3>bulan Ini</h3>

            <table border="1">
                <%
                    java.sql.ResultSet resultGedung = statement.executeQuery("select * from jadwalpemakaiangedung");
                    String[] dataGedung = new String[31];
                    String[] dataGedung2 = new String[31];
                    int j = 0;
                    while (resultGedung.next()) {
                        dataGedung[j] = resultGedung.getString("bulan1");
                        dataGedung2[j] = resultGedung.getString("bulan2");
                        j++;
                    }

                    int i = 1;
                    while (i < 32) {
                %><tr><%
                        int k = 1;
                        while (k >= 1 && k <= 7) {
                    %>

                    <td bgcolor="<%=bgcolor(dataGedung[i - 1])%>"><%=i%><br>
                        <h5 >Status : <%
                                        if (bgcolor(dataGedung[i - 1]).equalsIgnoreCase("#6F6")) {
                                            out.print("Sedang Kosong");
                                        } else {
                                            out.print("Sudah Dipesan");
                                        }%></h5>                             
                    </td>

                    <%
                            i++;
                            k++;
                            if (i > 31) {
                                break;
                            }
                        }
                    %><tr><%
                    }
                    %>
            </table><br>



            <h3>bulan Depan</h3>
            <table border="1">
                <%

                    i = 1;
                    while (i < 32) {
                %><tr><%
                        int k = 1;
                        while (k >= 1 && k <= 7) {
                    %>

                    <td bgcolor="<%=bgcolor(dataGedung2[i - 1])%>"><%=i%><br>
                        <h5 >Status : <%
                                     if (bgcolor(dataGedung2[i - 1]).equalsIgnoreCase("#6F6")) {
                                         out.print("Sedang Kosong");
                                     } else {
                                         out.print("Sudah Dipesan");
                                     }%></h5>
                    </td>

                    <%
                            i++;
                            k++;
                            if (i > 31) {
                                break;
                            }
                        }
                    %><tr><%
                    }
                    %>
            </table>  <br>


        </td>
    </tr>
</table>

</body>
</html>

